package com.example.demo1;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.gevara);

        Button btn1 = findViewById(R.id.btn_turn);
        MyClickListener1 btnActivity = new MyClickListener1();

        btn1.setOnClickListener(btnActivity);


//        LinearLayout ll = new LinearLayout(this);
//        ll.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
//        ll.setBackgroundColor(Color.CYAN);
//        setContentView(ll);


    }


    class MyClickListener1 implements View.OnClickListener{

        @Override
        public void onClick(View view) {
            Log.e("TAG","点击跳转");

//            Intent intent = new Intent(MainActivity.this, ButtonActivity.class);
            Intent intent = new Intent(MainActivity.this, ConstraintActivity.class);
            startActivity(intent);
            overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
        }
    }

}